import 'package:flutter/foundation.dart';
import 'package:flutter_ebook/http/spider/spider_api.dart';
import 'package:flutter_ebook/model/activity.dart';

class HomeVM extends ChangeNotifier {
  List<Activity>? _activities;

  List<Activity>? get activities => _activities;

  set activity(List<Activity> activities) {
    _activities = activities;
    notifyListeners(); // to update the UI
  }

  Future fetchActivities() async {
    _activities = await SpiderApi.instance().fetchHomeData();
  }
}
